﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Tester.Models;

namespace Tester.Views;
internal class PickerWidget : IWidget , INotifyPropertyChanged
{
    public string Header { get; set; }
    public string? Description { get; set; }
    public bool IsOpen { get; set; }
    public Action<int>? PickerEventHandler { get; set; }
    public List<string>? ItemCollection { get; set; }



    public event PropertyChangedEventHandler? PropertyChanged;

    public byte Mode { get; set; }

    private int selectedIndex = -1;

    public int SelectedIndex
    {
        get
        {
            return selectedIndex;
        }
        set
        {
            if(selectedIndex != value)
            {
                selectedIndex = value;
                PickerEventHandler?.Invoke(selectedIndex);
            }
        }
    }


    public PickerWidget()
    {

    }
}
